package com.club.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@TableName(value = "sys_operation")
@Data
@Builder(toBuilder = true)
public class SysOperation extends BaseEntity implements Serializable {

    /**
     * 主键
     */
    @TableId(value = "operate_id", type = IdType.AUTO)
    private int operateId;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private int userId;

    /**
     * 操作信息
     */
    @TableField(value = "operate_msg")
    private String operateMsg;

    /**
     * 操作时间
     */
    @JsonSerialize(using = CustomDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 登录时间
     */
    @JsonSerialize(using = CustomDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "login_time")
    private Date loginTime;
}
